from public.message import query_currency_msg
from public.currency import Currency
from webpage.webClient import get_web_client


def user_info(request):
    if qq := request.user.username:
        coin = get_web_client().send(query_currency_msg.build(
            user_id=int(qq),
            currency=Currency.coin.name,
        ))
    else:
        coin = None

    return {
        'qq': qq,
        'coin': coin
    }
